package com.demo.controllers;

import com.demo.base.aop.opLog;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Gred on 2017/5/23.
 */
@Controller
@RequestMapping("/")
public class demoController {



    @RequestMapping("/index.page")
    public String test(){
        return "/demo/index";
    }

    @opLog(opCode = 1,opName = "test",beforeRemark = "beforeRemark",afterRemark = "afterRemark")
    @RequestMapping("/testAop.page")
    public String testAop(@RequestParam String beforeRemark,
                          @RequestParam String afterRemark,
                          @RequestParam String test,
                          Model model){

        model.addAttribute("test",test);
        return "/demo/success";
    }

}
